#ifndef _SNAKE_H 
#define _SNAKE_H 

//Includes Classes pre-definidas no c 
#include <stdio.h> 
#include <go32.h> 
#include <sys/farptr.h>  
#include <string.h> 
#include <dos.h> 
#include <conio.h> 
#include <stdlib.h> 
#include <sys/nearptr.h> 
#include <dpmi.h> 
#include <pc.h> 
#include <time.h> //para funcao random 

//Includes da Biblioteca Pessoal 
#include "utypes.h" 
#include "video-text.h" //placa modo texto 
#include "video-graphics.h" //placa modo grafico 
#include "music.h" //altifalante 
#include "timer.h"  
#include "ints.h" //interrupcoes 
#include "queue.h" 
#include "kbc.h" 
#include "rtc.h" 
#include "ranking.h"
#include "codepage.h"
//#include "GQueue.h" 
//#include "gqueue.h" 

/** @defgroup Snake Snake 
  * @{ 
  * 
  * Funcoes para a execucao do jogo 
  */ 

/*Definicao de variaveis*/ 

#define LEFT 1 
#define RIGHT 2 
#define UP 3 
#define DOWN 4 
#define BEND_SIZE 1000 

/*struct Position { 
         int x; // Stores Head X Coordinate 
         int y; // Stores Head Y Coordinate 
         int dir; // Stores Head Direction 
 }*/ 

/** Estrutura SNAKE */ 
typedef struct { 
	int length_p; 
	int length; 
	int head_x; // Stores Head X Coordinate 
	int head_y; // Stores Head Y Coordinate 
	int head_dir; // Stores Head Direction 
	int tail_x; // Stores Tail X Coordinat 
	int tail_y; // Stores Tail Y Coordinat 
	int tail_dir; // Stores Tail Direction 
	int bend_x [BEND_SIZE]; //Stores X Bend Coordinate Declare it big enough to accomodate maximum bends 
	int bend_y[BEND_SIZE]; // Stores Y Bend Coordinate Declare it big enough to accomodate maximum bends  
	int bend_dir[BEND_SIZE]; 
} snake; // Declares a variable of the structure 

//Funcoes do main 
void ver_erros(); 
void reset_margin(); 
void initsnake(); 
void initscreen(); 
void gera_comida(); 
void apaga_comida(); 
void userinput(); 
int verifica_colisao(); 
void movesnake(); 
void moves(); 
int randomvalue (int starting, int ending);
void start();
void finish() ;
void playsnake();
void saveScore();

#endif 
